GetEnumerator Method

Task Parallel System.Threading

Returns an enumerator that iterates through the ConcurrentDictionary<(Of <(TKey, TValue>)>).

Namespace:  System.Collections.Concurrent
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Function GetEnumerator As IEnumerator(Of KeyValuePair(Of TKey, TValue))
C#
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()

Return Value

An enumerator for the ConcurrentDictionary<(Of <(TKey, TValue>)>).

Implements

IEnumerable<(Of <(T>)>)..::.GetEnumerator()()()

Remarks

The enumerator returned from the dictionary is safe to use concurrently with reads and writes to the dictionary, however it does not represent a moment-in-time snapshot of the dictionary. The contents exposed through the enumerator may contain modifications made to the dictionary after GetEnumerator()()() was called.

See Also